<?php
Route::group(['prefix'=>'home'],function (){
    Route::post('more','HomeController@more');
});
Route::get('/', 'HomeController@index');

Route::group(['prefix' => 'product'], function () {
    //商品分类
    Route::get('category', 'ProductController@category');

    Route::get('product_list', 'ProductController@product_list');//商品列表
    Route::get('show', 'ProductController@show');//商品展示
    Route::get('search', 'ProductController@search');//搜索
});

//购物车
Route::group(['prefix' => 'cart'], function () {
    Route::get('/', 'CartController@index');//首页
    Route::patch('add', 'CartController@add');//增加
    Route::patch('sub', 'CartController@sub');//减少
    Route::post('add_cart', 'CartController@add_cart');//添加商品到购物车
    Route::delete('delete_cart', 'CartController@delete_cart');//删除购物车商品
});

//订单
Route::group(['prefix' => 'order'], function () {
    Route::get('check_out', 'OrderController@check_out');//去结算

    Route::post('/', 'OrderController@store');//生成订单
    Route::get('show_pay/{id}', 'OrderController@show_pay');//去付款

    Route::get('{id}', 'OrderController@index');//全部订单
    Route::get('show/{id}', 'OrderController@show');//订单详情

    Route::delete('{id}', 'OrderController@destroy');//删除订单
});

//地址
Route::group(['prefix' => 'address'], function () {
    //改变默认地址
    Route::patch('default_address', 'AddressController@default_address');
    //管理地址
    Route::get('manage', 'AddressController@manage');

});
Route::resource('address', 'AddressController');

//服务
Route::group(['prefix' => 'customer'], function () {
    Route::get('index', 'CustomerController@index');
});